//
//  BaseWebInfo.swift
//  Exchange
//
//  Created by 孟祥群 on 2018/5/10.
//  Copyright © 2018年 common. All rights reserved.
//

import UIKit
protocol CYWebInfoProtocol {
    var openUrl:String?  {get set}
    var writeData:Dictionary<String, AnyObject> {get set}
    var oneceMovement:Bool {get set}
}
class ExchangeWebInfo: NSObject  {
    var dataSource:CYWebInfoProtocol?
    var baseUrl = "ws://47.52.197.242:12389"
    var requestUrl: String? {
        get {
            if dataSource != nil && dataSource?.openUrl?.count != 0 {
                return dataSource?.openUrl
            }else {
                return baseUrl
            }
        }
    }
    
    override init() {
        super.init()
        if ((self as? CYWebInfoProtocol) != nil) {
            self.dataSource = self as? CYWebInfoProtocol
        }
    }
}
